package interactive.focusPhoto.item 
{
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.net.URLRequest;
	import flash.system.LoaderContext;
	/**
	 * swf元素
	 * @author Ning
	 */
	public class SwfItem extends PhotoItem 
	{
		
		protected var mc:MovieClip;
		public function SwfItem() 
		{
			
		}
		override public function load():void 
		{
			super.load();
		}
		override public function die():void 
		{
			super.die();
			mc = null;
		}
		override protected function loadContent():void 
		{
			loader.load(new URLRequest(data.SWF_URL), new LoaderContext(true));
		}
		override protected function onComplete(evt:Event):void 
		{
			super.onComplete(evt);
			if (content is MovieClip) {
			    mc = content as MovieClip;
				stop();
			}
			if (autoPlay)
			    play();
		}
		override public function play():void
		{
			if (mc) {
				stop();
				mc.play();
			}
		}
		override public function stop():void
		{
			if (mc) {
				mc.gotoAndStop(1);
			}
		}
	}
}